package com.pactera.madp.cp.api.em.workmessage;

/**
 * 消息动作
 * @author yushen.qi
 */
public enum MsgEnum {

    /**
     * 已发送
     */
    SEND(0, "已发送"),
    /**
     * 已撤回
     */
    REVOKE(1, "已撤回"),
    /**
     * 切换企业日志
     */
    SWITCH(2, "切换企业日志");

    private final int code;
    private final String msg;

    MsgEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
    public static String getEnum(int code) {
        MsgEnum[] enums = MsgEnum.values();
        for (MsgEnum anEnum : enums) {
            if (code == anEnum.code) {
                return anEnum.getMsg();
            }
        }
        return "";
    }

}
